<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
  <button id = 'minus'>-1</button>  
  <input type="text" name="" id="num" value="0" >
  <button id = 'add'>+1</button>
</body>
<script>
    let minus = document.querySelector('#minus');
    let num = document.querySelector('#num');
    let add = document.querySelector('#add');

    add.onclick = function(){
        let nums = num.value;
        nums = parseInt(nums)
        nums += 1;
        num.value = nums;
    }
    minus.onclick = function(){
        let nums = num.value;
        nums = parseInt(nums);
        nums -= 1;
        num.value = nums;
    }
</script>
</html>    